<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="Generator" content="JDoc®">
    <meta name="Author" content="JDoc-jxtpro">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <title>JDoc</title>
    <link rel="stylesheet" href="layui/css/layui.css">
</head>

<body>
    <!-- 布局容器 -->
    <div class="layui-layout layui-layout-admin">
        <!-- 头部 -->
        <div class="layui-header">
            <div class="layui-main">
                <!-- logo -->
                <a href="/" style="color: #c2c2c2; font-size: 18px; line-height: 60px;">JDoc</a>
                <!-- 水平导航 -->
                <ul class="layui-nav" style="position: absolute; top: 0; right: 0; background: none;">
                    <li class="layui-nav-item">
                        <a href="javascript:;">
                            用户名
                        </a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a href="#" onclick="showOrUpdateInfo(id)">
                                    个人信息
                                </a>
                            </dd>
                            <dd>
                                <a href="#" onclick="showOrUpdateInfo(id)">
                                    修改密码
                                </a>
                            </dd>
                            <dd>
                                 <a href="#" onclick="exit()">
                                    退出登录
                                </a>
                            </dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>

        <!-- 侧边栏 -->
        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <ul class="layui-nav layui-nav-tree" lay-filter="left-nav" style="border-radius: 0;">
                </ul>
            </div>
        </div>

        <!-- 主体 -->
        <div class="layui-body">
            <!-- 顶部切换卡 -->
            <div class="layui-tab layui-tab-brief" lay-filter="top-tab" lay-allowClose="true" style="margin: 0;">
                <ul class="layui-tab-title"></ul>
                <div class="layui-tab-content"></div>
            </div>
        </div>

        <!-- 底部 -->
        <div class="layui-footer" style="text-align: center; line-height: 44px;">
            Copyright © 2017 <a href="https://git.oschina.net/lianghao2016/JDoc" target="_blank">JDoc</a> Powered by JDoc
        </div>
    </div>

    <script type="text/javascript" src="layui/layui.js"></script>
    <script type="text/javascript">
        /**
         * 对layui进行全局配置
         */
        layui.config({
            base: 'js/'
        });

        /**
         * 初始化整个cms骨架
         */
        layui.use(['cms'], function() {
            var cms = layui.cms('left-nav', 'top-tab');

            cms.addNav([
                {id: 1, pid: 0, node: '应用管理', url: 'main.html'},
                {id: 2, pid: 1, node: '应用组管理', url: 'app_groups.html'},
                {id: 3, pid: 1, node: 'API管理', url: 'api_list.html'},
            ], 0, 'id', 'pid', 'node', 'url');

            cms.bind(60 + 41 + 20 + 44); //头部高度 + 顶部切换卡标题高度 + 顶部切换卡内容padding + 底部高度
            cms.clickLI(2);
        });
        //显示或修改用户信息
        function showOrUpdateInfo(id){
        		 layui.use('layer', function(){
			  var layer = layui.layer;
			  
			  layer.open({
			  	  area: ['720px', '450px'],
			  	  maxmin:true,
				  type: 2, 
				  content: 'info.html'
			  }); 
			});     
        }
        //退出
        function exit(){
        		layui.use('layer', function(){
			  var layer = layui.layer;
			  layer.confirm('是否退出?', {icon: 3, title:'请确认'}, function(index){
			  	  location.href='signin.html';
				  layer.close(index);
			  });
			});  
        	
        }
    </script>
</body>
</html>